package api

import (
	"jgt-oper/src/bll"
	"jgt-oper/src/context"
)

// AppVersion 应用版本
type AppVersion struct {
	AppVersionBll *bll.AppVersion `inject:""`
}

// CheckUpgrade 检查版本升级
func (a *AppVersion) CheckUpgrade(ctx *context.Context) error {
	appParam := ctx.GetAPPParameter()
	data, err := a.AppVersionBll.CheckUpgrade(appParam.DeviceType, appParam.Version)
	if err != nil {
		return ctx.ResErrInternalServer(err)
	}
	return ctx.ResSuccess(data)
}
